package com.ssi.action.shop;

import java.util.List;

import com.ssi.action.CommonAction;
import com.ssi.domain.goodstype.Goodstype;
import com.ssi.domain.shop.Shop;
import com.ssi.service.goods.GoodsService;
import com.ssi.service.goodstype.GoodstypeService;
import com.ssi.service.shop.ShopService;

/**
 * 
 * @author lxf
 * 
 */
public class ShopAction extends CommonAction {
	private ShopService shopService;
	private GoodstypeService goodstypeService;
	private GoodsService goodsService;
	

	public ShopService getShopService() {
		return shopService;
	}

	public void setShopService(ShopService shopService) {
		this.shopService = shopService;
	}

	public GoodstypeService getGoodstypeService() {
		return goodstypeService;
	}

	public void setGoodstypeService(GoodstypeService goodstypeService) {
		this.goodstypeService = goodstypeService;
	}

	public GoodsService getGoodsService() {
		return goodsService;
	}

	public void setGoodsService(GoodsService goodsService) {
		this.goodsService = goodsService;
	}

	public String addShop(Shop shop) {
		shopService.addShop(shop);
		return "";
	}

	public String updateShop(Shop shop) {
		shopService.updateShop(shop);
		return "";
	}

	public String deleteShop() {
		int id = 0;
		shopService.deleteShop(id);
		return "";
	}

	public String entyrShopIndex() {
		 String key = getParameters("id");		
		System.out.println("=====>"+key);
		int id=Integer.parseInt(key);
		Shop shop = shopService.queryShopById(id);
		List<Goodstype> goodstype = goodstypeService.queryGoodstypeByShopId(shop.getId());
		goodsService.queryGoodsByShopId(shop.getId());
		return "shopIndex";
	}

	public String queryAllShopByName() {
		String name = "";
		shopService.queryAllShopByName(name);
		return "";
	}

	public String queryShopByUserId() {
		int id = 0;
		shopService.queryShopByUserId(id);
		return "";
	}

	public String queryAllShop() {
		shopService.queryAllShop();
		return "";
	}

}
